from PyQt5.QtWidgets import QHBoxLayout, QLabel, QLineEdit, QPushButton

class VideoInput(QHBoxLayout):
    def __init__(self):
        super().__init__()
        self.setup_ui()
        
    def setup_ui(self):
        # URL输入
        self.lbl_url = QLabel("视频地址:")
        self.txt_url = QLineEdit()
        self.txt_url.setPlaceholderText("请输入视频URL地址")
        self.txt_url.setMinimumWidth(300)
        
        # 按钮
        self.btn_fetch = QPushButton("获取视频数据")
        self.btn_clear = QPushButton("清空")
        # self.btn_download = QPushButton("下载视频")
        
        self.addWidget(self.lbl_url)
        self.addWidget(self.txt_url)
        self.addWidget(self.btn_fetch)
        self.addWidget(self.btn_clear)
        # self.addWidget(self.btn_download)
    
    def get_url(self):
        """获取当前输入的URL"""
        return self.txt_url.text().strip()
    
    def clear(self):
        """清空输入"""
        self.txt_url.clear()